.el-button {
  border-radius: 2px;
  font-weight: 400;
  vertical-align: 1px;

  [class^="icon-"],
  [class*=" icon-"] {
    margin-right: 4px;
  }

  &.is-loading {
    .el-icon-loading {
      display: none;
    }

    .iconfont.icon-loading {
      display: inline-block;
      margin-right: 4px;
      animation: rotating 1.2s linear infinite;
    }

    // &:after {
    //   content: "中";
    // }
  }

  &.is-round {
    border-radius: 100px;
  }
}

.el-button--default {
  color: #333;

  &:hover {
    background: #fff;
    color: #333;
    border-color: #999;
  }

  &:active,
  &:focus {
    border-color: @color-primary;
    background: #fff;
    color: @color-primary;
  }

  &.is-disabled {
    &,
    &:hover,
    &:active {
      background: #f2f2f2;
      border-color: #e5e5e5;
      color: #999;
    }
  }
}

.el-button--primary {
  color: #fff;
  background: @color-primary;
  border-color: @color-primary;

  &:hover {
    background: @color-light-primary;
    border-color: @color-primary;
    color: #fff;
  }

  &:active,
  &:focus {
    border-color: @color-deep-primary;
    background: @color-primary;
    color: #fff;
  }

  &.is-disabled {
    &,
    &:hover,
    &:active {
      background: #e5e5e5;
      border-color: #e5e5e5;
      color: #fff;
    }
  }
}

.el-button--primary.is-disabled {
  background: @color-light-gray;
  color: @color-sup;

  &:hover {
    background: @color-light-gray;
    color: @color-sup;
  }
}

.el-button--primary.is-plain.is-disabled {
  background: @color-light-gray;
  border: 1px solid @color-border;
  color: @color-sup;

  &:hover {
    background: @color-light-gray;
    border: 1px solid @color-border;
    color: @color-sup;
  }
}

.el-button--primary.is-loading.is-plain {
  border: 1px solid @color-border;
  background: #ffffff;
  color: @color-primary;
}

.mixin-btn-color (@bg-color-1, @bg-color-2, @bg-color-3) {
  background: @bg-color-1;
  border-color: @bg-color-1;
  color: #fff;

  &:hover {
    background: @bg-color-2;
    border-color: @bg-color-2;
    color: #fff;
  }

  &:active,
  &:focus {
    background: @bg-color-3;
    border-color: @bg-color-3;
    color: #fff;
  }
}

.el-button--warning {
  .mixin-btn-color(#F53636, #fc6363, #ee2727);
}

.el-button--subwarning {
  .mixin-btn-color(#FAA05F, #FFAF75, #F4934D);
}

// confirm 弹窗特殊需求
.el-button--default.el-button--primary.plain-button {
  &,
  &:hover,
  &:active,
  &:focus {
    background: #fff !important;
    color: #333 !important;
    border-color: #999 !important;
  }
}

.el-button--text {
  padding: 0 !important;
  vertical-align: 0;
}

.el-button--large,
.el-button--large.is-round {
  padding: 13px 38px;
  font-size: @font-title;
}

.el-button--medium,
.el-button--medium.is-round {
  padding: 10px 16px;
  font-size: @font-content;
  box-sizing: border-box;
  height: 40px;

  .iconfont-handle {
    font-size: @font-content;
  }
}

.el-button--small,
.el-button--small.is-round {
  padding: 9px 16px;
  font-size: @font-content;
  box-sizing: border-box;
  height: 32px;

  .iconfont-handle {
    font-size: @font-small;
  }
}

.el-button--mini,
.el-button--mini.is-round {
  padding: 4px 8px;
  font-size: @font-small;
  box-sizing: border-box;
  height: 24px;
}

.el-button--text.el-button--mini {
  min-width: auto;
}

.el-button--danger {
  background-color: @color-red;
  color: #fff;
}

.el-button--danger.is-plain {
  color: @color-red;
  background-color: #fff;
  border: 1px solid @color-red;
}

.db-delete-btn {
  .el-icon,
  .iconfont-handle {
    font-size: @font-title;
    font-weight: 700;
    color: #bbb;

    &:hover,
    &:active {
      color: #ff795c;
    }
  }
}

@keyframes rotating {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
